        <!DOCTYPE html>
        <html>
        <head>
                <meta charset="utf-8">
        <title>Settings class / box2d_html Library / Dart Documentation</title>
        <link rel="stylesheet" type="text/css"
            href="../styles.css">
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800" rel="stylesheet" type="text/css">
        <link rel="shortcut icon" href="../favicon.ico">
        
        </head>
        <body data-library="box2d_html" data-type="Settings">
        <div class="page">
        <div class="header">
          <a href="../index.html"><div class="logo"></div></a>
          <a href="../index.html">Dart Documentation</a>
         &rsaquo; <a href="../box2d_html.html">box2d_html</a> &rsaquo; <a href="../box2d_html/Settings.html">Settings</a>        <div id="search-box">
          <input type="search" name="q" id="q" autocomplete="off"
              class="search-input" placeholder="Search API">
        </div>
        
      </div>
      <div class="drop-down" id="drop-down"></div>
      
        <div class="nav">
        
</div>
<div class="content">
        <h2><strong>Settings</strong>
          class
        </h2>
        
<button id="show-inherited" class="show-inherited">Hide inherited</button>
<div class="doc">
<p>Global tuning constants based on MKS units and various integer
maximums(vertices per shape, pairs, etc.).</p>
<pre class="source">
class Settings {
  /** Size that pool stacks are initialized to. */
  static const int CONTACT_STACK_INIT_SIZE = 10;

  /** A "close to Zero" num epsilon value for use */
  static const num EPSILON = .0000001192;

  /**
   * Maximum number of contacts to be handled to solve a TimeOfImpact island.
   */
  static const int MAX_TIME_OF_IMPACT_CONTACTS = 32;

  /**
   * A body cannot sleep if its linear velocity is above this tolerance.
   */
  static const num LINEAR_SLEEP_TOLERANCE = 0.01;

  /**
   * The maximum linear position correction used when solving constraints.
   * This helps to prevent overshoot.
   */
  static const num MAX_LINEAR_CORRECTION = 0.2;

  /**
   * A body cannot sleep if its angular velocity is above this tolerance.
   */
  static const num ANGULAR_SLEEP_TOLERANCE = 2.0 / 180.0 * Math.PI;

  static const num TIME_TO_SLEEP = 0.5;

  static const int TREE_REBALANCE_STEPS = 4;

  static const int MAX_INTEGER = 2147483647;

  static const num SMALL_NUMBER = .000000000001;
  static const num BIG_NUMBER = 99999999999999.0;

  /**
   * A small length used as a collision and constant tolerance. Usually it
   * is chosen to be numerically significant, but visually insignificant.
   */
  static const num LINEAR_SLOP = 0.005;

  /**
   * The radius of the polygon/edge shape skin. This should not be modified.
   * Making this smaller means polygons will have and insufficient for
   * continuous collision. Making it larger may create artifacts for vertex
   * collision.
   */
  static const num POLYGON_RADIUS = 2.0 * LINEAR_SLOP;

  static const num VELOCITY_THRESHOLD = 1;

  /**
   * Fattens bounding boxes in the dynamic tree by this amount. Allows proxies
   * to move by small amounts without needing to adjust the tree. This value is
   * in meters.
   */
  static const num BOUNDING_BOX_EXTENSION = .1;

  /**
   * This is used to fatten AABBs in the dynamic tree. This is used to predict
   * the future position based on the current displacement.
   * This is a dimensionless multiplier.
   */
  static const num BOUNDING_BOX_MULTIPLIER = 2;

  /**
   * This scale factor controls how fast overlap is resolved. Ideally this
   * would be 1 so that overlap is removed in one time step. However using
   * values close to 1 often lead to overshoot.
   */
  static const num CONTACT_BAUMGARTE = 0.2;

  /**
   * The maximum linear velocity of a body. This limit is very large and is
   * used to prevent numerical problems. You shouldn't need to adjust this.
   */
  static const num MAX_TRANSLATION = 2.0;
  static const num MAX_TRANSLATION_SQUARED = MAX_TRANSLATION * MAX_TRANSLATION;

  /**
   * The maximum angular velocity of a body. This limit is very large and is
   * used to prevent numerical problems. You shouldn't need to adjust this.
   */
  static const num MAX_ROTATION = 0.5 * Math.PI;
  static const num MAX_ROTATION_SQUARED = MAX_ROTATION * MAX_ROTATION;

  /**
   * The maximum number of contact points between two convex shapes.
   */
  static const int MAX_MANIFOLD_POINTS = 2;

  /**
   * A small angle used as a collision and constraint tolerance. Usually it is
   * chosen to be numerically significant, but visually insignificant.
   */
  static const num ANGULAR_SLOP = (2.0 / 180.0 * Math.PI);

  /**
   * The maximum angular position correction used when solving constraints.
   * This helps to prevent overshoot.
   */
  static const num MAX_ANGULAR_CORRECTION = (8.0 / 180.0 * Math.PI);

  /**
   * The maximum number of vertices on a convex polygon.
   */
  static const int MAX_POLYGON_VERTICES = 8;

  /**
   * Friction mixing law.
   */
  static num mixFriction(num friction1, num friction2) {
    return Math.sqrt(friction1 * friction2);
  }

  /**
   * Restitution mixing law.
   */
  static num mixRestitution(num restitution1, num restitution2) {
    return restitution1 &gt; restitution2 ? restitution1 : restitution2;
  }
}
</pre>
</div>
<div>
<h3>Static Properties</h3>
<div class="field"><h4 id="ANGULAR_SLEEP_TOLERANCE">
<button class="show-code">Code</button>
const num         <strong>ANGULAR_SLEEP_TOLERANCE</strong> <a class="anchor-link"
            href="#ANGULAR_SLEEP_TOLERANCE"
            title="Permalink to Settings.ANGULAR_SLEEP_TOLERANCE">#</a>
        </h4>
        <div class="doc">
<p>A body cannot sleep if its angular velocity is above this tolerance.</p>
<pre class="source">
static const num ANGULAR_SLEEP_TOLERANCE = 2.0 / 180.0 * Math.PI;
</pre>
</div>
</div>
<div class="field"><h4 id="ANGULAR_SLOP">
<button class="show-code">Code</button>
const num         <strong>ANGULAR_SLOP</strong> <a class="anchor-link"
            href="#ANGULAR_SLOP"
            title="Permalink to Settings.ANGULAR_SLOP">#</a>
        </h4>
        <div class="doc">
<p>A small angle used as a collision and constraint tolerance. Usually it is
chosen to be numerically significant, but visually insignificant.</p>
<pre class="source">
static const num ANGULAR_SLOP = (2.0 / 180.0 * Math.PI);
</pre>
</div>
</div>
<div class="field"><h4 id="BIG_NUMBER">
<button class="show-code">Code</button>
const num         <strong>BIG_NUMBER</strong> <a class="anchor-link"
            href="#BIG_NUMBER"
            title="Permalink to Settings.BIG_NUMBER">#</a>
        </h4>
        <div class="doc">
<pre class="source">
static const num BIG_NUMBER = 99999999999999.0;
</pre>
</div>
</div>
<div class="field"><h4 id="BOUNDING_BOX_EXTENSION">
<button class="show-code">Code</button>
const num         <strong>BOUNDING_BOX_EXTENSION</strong> <a class="anchor-link"
            href="#BOUNDING_BOX_EXTENSION"
            title="Permalink to Settings.BOUNDING_BOX_EXTENSION">#</a>
        </h4>
        <div class="doc">
<p>Fattens bounding boxes in the dynamic tree by this amount. Allows proxies
to move by small amounts without needing to adjust the tree. This value is
in meters.</p>
<pre class="source">
static const num BOUNDING_BOX_EXTENSION = .1;
</pre>
</div>
</div>
<div class="field"><h4 id="BOUNDING_BOX_MULTIPLIER">
<button class="show-code">Code</button>
const num         <strong>BOUNDING_BOX_MULTIPLIER</strong> <a class="anchor-link"
            href="#BOUNDING_BOX_MULTIPLIER"
            title="Permalink to Settings.BOUNDING_BOX_MULTIPLIER">#</a>
        </h4>
        <div class="doc">
<p>This is used to fatten AABBs in the dynamic tree. This is used to predict
the future position based on the current displacement.
This is a dimensionless multiplier.</p>
<pre class="source">
static const num BOUNDING_BOX_MULTIPLIER = 2;
</pre>
</div>
</div>
<div class="field"><h4 id="CONTACT_BAUMGARTE">
<button class="show-code">Code</button>
const num         <strong>CONTACT_BAUMGARTE</strong> <a class="anchor-link"
            href="#CONTACT_BAUMGARTE"
            title="Permalink to Settings.CONTACT_BAUMGARTE">#</a>
        </h4>
        <div class="doc">
<p>This scale factor controls how fast overlap is resolved. Ideally this
would be 1 so that overlap is removed in one time step. However using
values close to 1 often lead to overshoot.</p>
<pre class="source">
static const num CONTACT_BAUMGARTE = 0.2;
</pre>
</div>
</div>
<div class="field"><h4 id="CONTACT_STACK_INIT_SIZE">
<button class="show-code">Code</button>
const int         <strong>CONTACT_STACK_INIT_SIZE</strong> <a class="anchor-link"
            href="#CONTACT_STACK_INIT_SIZE"
            title="Permalink to Settings.CONTACT_STACK_INIT_SIZE">#</a>
        </h4>
        <div class="doc">
<p>Size that pool stacks are initialized to.</p>
<pre class="source">
static const int CONTACT_STACK_INIT_SIZE = 10;
</pre>
</div>
</div>
<div class="field"><h4 id="EPSILON">
<button class="show-code">Code</button>
const num         <strong>EPSILON</strong> <a class="anchor-link"
            href="#EPSILON"
            title="Permalink to Settings.EPSILON">#</a>
        </h4>
        <div class="doc">
<p>A "close to Zero" num epsilon value for use</p>
<pre class="source">
static const num EPSILON = .0000001192;
</pre>
</div>
</div>
<div class="field"><h4 id="LINEAR_SLEEP_TOLERANCE">
<button class="show-code">Code</button>
const num         <strong>LINEAR_SLEEP_TOLERANCE</strong> <a class="anchor-link"
            href="#LINEAR_SLEEP_TOLERANCE"
            title="Permalink to Settings.LINEAR_SLEEP_TOLERANCE">#</a>
        </h4>
        <div class="doc">
<p>A body cannot sleep if its linear velocity is above this tolerance.</p>
<pre class="source">
static const num LINEAR_SLEEP_TOLERANCE = 0.01;
</pre>
</div>
</div>
<div class="field"><h4 id="LINEAR_SLOP">
<button class="show-code">Code</button>
const num         <strong>LINEAR_SLOP</strong> <a class="anchor-link"
            href="#LINEAR_SLOP"
            title="Permalink to Settings.LINEAR_SLOP">#</a>
        </h4>
        <div class="doc">
<p>A small length used as a collision and constant tolerance. Usually it
is chosen to be numerically significant, but visually insignificant.</p>
<pre class="source">
static const num LINEAR_SLOP = 0.005;
</pre>
</div>
</div>
<div class="field"><h4 id="MAX_ANGULAR_CORRECTION">
<button class="show-code">Code</button>
const num         <strong>MAX_ANGULAR_CORRECTION</strong> <a class="anchor-link"
            href="#MAX_ANGULAR_CORRECTION"
            title="Permalink to Settings.MAX_ANGULAR_CORRECTION">#</a>
        </h4>
        <div class="doc">
<p>The maximum angular position correction used when solving constraints.
This helps to prevent overshoot.</p>
<pre class="source">
static const num MAX_ANGULAR_CORRECTION = (8.0 / 180.0 * Math.PI);
</pre>
</div>
</div>
<div class="field"><h4 id="MAX_INTEGER">
<button class="show-code">Code</button>
const int         <strong>MAX_INTEGER</strong> <a class="anchor-link"
            href="#MAX_INTEGER"
            title="Permalink to Settings.MAX_INTEGER">#</a>
        </h4>
        <div class="doc">
<pre class="source">
static const int MAX_INTEGER = 2147483647;
</pre>
</div>
</div>
<div class="field"><h4 id="MAX_LINEAR_CORRECTION">
<button class="show-code">Code</button>
const num         <strong>MAX_LINEAR_CORRECTION</strong> <a class="anchor-link"
            href="#MAX_LINEAR_CORRECTION"
            title="Permalink to Settings.MAX_LINEAR_CORRECTION">#</a>
        </h4>
        <div class="doc">
<p>The maximum linear position correction used when solving constraints.
This helps to prevent overshoot.</p>
<pre class="source">
static const num MAX_LINEAR_CORRECTION = 0.2;
</pre>
</div>
</div>
<div class="field"><h4 id="MAX_MANIFOLD_POINTS">
<button class="show-code">Code</button>
const int         <strong>MAX_MANIFOLD_POINTS</strong> <a class="anchor-link"
            href="#MAX_MANIFOLD_POINTS"
            title="Permalink to Settings.MAX_MANIFOLD_POINTS">#</a>
        </h4>
        <div class="doc">
<p>The maximum number of contact points between two convex shapes.</p>
<pre class="source">
static const int MAX_MANIFOLD_POINTS = 2;
</pre>
</div>
</div>
<div class="field"><h4 id="MAX_POLYGON_VERTICES">
<button class="show-code">Code</button>
const int         <strong>MAX_POLYGON_VERTICES</strong> <a class="anchor-link"
            href="#MAX_POLYGON_VERTICES"
            title="Permalink to Settings.MAX_POLYGON_VERTICES">#</a>
        </h4>
        <div class="doc">
<p>The maximum number of vertices on a convex polygon.</p>
<pre class="source">
static const int MAX_POLYGON_VERTICES = 8;
</pre>
</div>
</div>
<div class="field"><h4 id="MAX_ROTATION">
<button class="show-code">Code</button>
const num         <strong>MAX_ROTATION</strong> <a class="anchor-link"
            href="#MAX_ROTATION"
            title="Permalink to Settings.MAX_ROTATION">#</a>
        </h4>
        <div class="doc">
<p>The maximum angular velocity of a body. This limit is very large and is
used to prevent numerical problems. You shouldn't need to adjust this.</p>
<pre class="source">
static const num MAX_ROTATION = 0.5 * Math.PI;
</pre>
</div>
</div>
<div class="field"><h4 id="MAX_ROTATION_SQUARED">
<button class="show-code">Code</button>
const num         <strong>MAX_ROTATION_SQUARED</strong> <a class="anchor-link"
            href="#MAX_ROTATION_SQUARED"
            title="Permalink to Settings.MAX_ROTATION_SQUARED">#</a>
        </h4>
        <div class="doc">
<pre class="source">
static const num MAX_ROTATION_SQUARED = MAX_ROTATION * MAX_ROTATION;
</pre>
</div>
</div>
<div class="field"><h4 id="MAX_TIME_OF_IMPACT_CONTACTS">
<button class="show-code">Code</button>
const int         <strong>MAX_TIME_OF_IMPACT_CONTACTS</strong> <a class="anchor-link"
            href="#MAX_TIME_OF_IMPACT_CONTACTS"
            title="Permalink to Settings.MAX_TIME_OF_IMPACT_CONTACTS">#</a>
        </h4>
        <div class="doc">
<p>Maximum number of contacts to be handled to solve a TimeOfImpact island.</p>
<pre class="source">
static const int MAX_TIME_OF_IMPACT_CONTACTS = 32;
</pre>
</div>
</div>
<div class="field"><h4 id="MAX_TRANSLATION">
<button class="show-code">Code</button>
const num         <strong>MAX_TRANSLATION</strong> <a class="anchor-link"
            href="#MAX_TRANSLATION"
            title="Permalink to Settings.MAX_TRANSLATION">#</a>
        </h4>
        <div class="doc">
<p>The maximum linear velocity of a body. This limit is very large and is
used to prevent numerical problems. You shouldn't need to adjust this.</p>
<pre class="source">
static const num MAX_TRANSLATION = 2.0;
</pre>
</div>
</div>
<div class="field"><h4 id="MAX_TRANSLATION_SQUARED">
<button class="show-code">Code</button>
const num         <strong>MAX_TRANSLATION_SQUARED</strong> <a class="anchor-link"
            href="#MAX_TRANSLATION_SQUARED"
            title="Permalink to Settings.MAX_TRANSLATION_SQUARED">#</a>
        </h4>
        <div class="doc">
<pre class="source">
static const num MAX_TRANSLATION_SQUARED = MAX_TRANSLATION * MAX_TRANSLATION;
</pre>
</div>
</div>
<div class="field"><h4 id="POLYGON_RADIUS">
<button class="show-code">Code</button>
const num         <strong>POLYGON_RADIUS</strong> <a class="anchor-link"
            href="#POLYGON_RADIUS"
            title="Permalink to Settings.POLYGON_RADIUS">#</a>
        </h4>
        <div class="doc">
<p>The radius of the polygon/edge shape skin. This should not be modified.
Making this smaller means polygons will have and insufficient for
continuous collision. Making it larger may create artifacts for vertex
collision.</p>
<pre class="source">
static const num POLYGON_RADIUS = 2.0 * LINEAR_SLOP;
</pre>
</div>
</div>
<div class="field"><h4 id="SMALL_NUMBER">
<button class="show-code">Code</button>
const num         <strong>SMALL_NUMBER</strong> <a class="anchor-link"
            href="#SMALL_NUMBER"
            title="Permalink to Settings.SMALL_NUMBER">#</a>
        </h4>
        <div class="doc">
<pre class="source">
static const num SMALL_NUMBER = .000000000001;
</pre>
</div>
</div>
<div class="field"><h4 id="TIME_TO_SLEEP">
<button class="show-code">Code</button>
const num         <strong>TIME_TO_SLEEP</strong> <a class="anchor-link"
            href="#TIME_TO_SLEEP"
            title="Permalink to Settings.TIME_TO_SLEEP">#</a>
        </h4>
        <div class="doc">
<pre class="source">
static const num TIME_TO_SLEEP = 0.5;
</pre>
</div>
</div>
<div class="field"><h4 id="TREE_REBALANCE_STEPS">
<button class="show-code">Code</button>
const int         <strong>TREE_REBALANCE_STEPS</strong> <a class="anchor-link"
            href="#TREE_REBALANCE_STEPS"
            title="Permalink to Settings.TREE_REBALANCE_STEPS">#</a>
        </h4>
        <div class="doc">
<pre class="source">
static const int TREE_REBALANCE_STEPS = 4;
</pre>
</div>
</div>
<div class="field"><h4 id="VELOCITY_THRESHOLD">
<button class="show-code">Code</button>
const num         <strong>VELOCITY_THRESHOLD</strong> <a class="anchor-link"
            href="#VELOCITY_THRESHOLD"
            title="Permalink to Settings.VELOCITY_THRESHOLD">#</a>
        </h4>
        <div class="doc">
<pre class="source">
static const num VELOCITY_THRESHOLD = 1;
</pre>
</div>
</div>
</div>
<div>
<h3>Static Methods</h3>
<div class="method"><h4 id="mixFriction">
<button class="show-code">Code</button>
num <strong>mixFriction</strong>(num friction1, num friction2) <a class="anchor-link" href="#mixFriction"
              title="Permalink to Settings.mixFriction">#</a></h4>
<div class="doc">
<p>Friction mixing law.</p>
<pre class="source">
static num mixFriction(num friction1, num friction2) {
  return Math.sqrt(friction1 * friction2);
}
</pre>
</div>
</div>
<div class="method"><h4 id="mixRestitution">
<button class="show-code">Code</button>
num <strong>mixRestitution</strong>(num restitution1, num restitution2) <a class="anchor-link" href="#mixRestitution"
              title="Permalink to Settings.mixRestitution">#</a></h4>
<div class="doc">
<p>Restitution mixing law.</p>
<pre class="source">
static num mixRestitution(num restitution1, num restitution2) {
  return restitution1 &gt; restitution2 ? restitution1 : restitution2;
}
</pre>
</div>
</div>
</div>
<div>
<h3>Properties</h3>
<div class="field inherited"><h4 id="runtimeType">
<button class="show-code">Code</button>
final Type         <strong>runtimeType</strong> <a class="anchor-link"
            href="#runtimeType"
            title="Permalink to Settings.runtimeType">#</a>
        </h4>
        <div class="inherited-from">inherited from Object </div><div class="doc">
<p>A representation of the runtime type of the object.</p>
<pre class="source">
external Type get runtimeType;
</pre>
</div>
</div>
</div>
<div>
<h3>Operators</h3>
<div class="method inherited"><h4 id="==">
<button class="show-code">Code</button>
bool <strong>operator ==</strong>(other) <a class="anchor-link" href="#=="
              title="Permalink to Settings.operator ==">#</a></h4>
<div class="inherited-from">inherited from Object </div><div class="doc">
<p>The equality operator.</p>
<p>The default behavior for all <code>Object</code>s is to return true if and
only if <code>this</code> and 
<span class="param">other</span> are the same object.</p>
<p>If a subclass overrides the equality operator it should override
the <code>hashCode</code> method as well to maintain consistency.</p>
<pre class="source">
bool operator ==(other) =&gt; identical(this, other);
</pre>
</div>
</div>
</div>
<div>
<h3>Methods</h3>
<div class="method inherited"><h4 id="hashCode">
<button class="show-code">Code</button>
int <strong>hashCode</strong>() <a class="anchor-link" href="#hashCode"
              title="Permalink to Settings.hashCode">#</a></h4>
<div class="inherited-from">inherited from Object </div><div class="doc">
<p>Get a hash code for this object.</p>
<p>All objects have hash codes. Hash codes are guaranteed to be the
same for objects that are equal when compared using the equality
operator <code>==</code>. Other than that there are no guarantees about
the hash codes. They will not be consistent between runs and
there are no distribution guarantees.</p>
<p>If a subclass overrides <code>hashCode</code> it should override the
equality operator as well to maintain consistency.</p>
<pre class="source">
external int hashCode();
</pre>
</div>
</div>
<div class="method inherited"><h4 id="noSuchMethod">
<button class="show-code">Code</button>
<strong>noSuchMethod</strong>(String name, List args) <a class="anchor-link" href="#noSuchMethod"
              title="Permalink to Settings.noSuchMethod">#</a></h4>
<div class="inherited-from">inherited from Object </div><div class="doc">
<p><code>noSuchMethod</code> is invoked when users invoke a non-existant method
on an object. The name of the method and the arguments of the
invocation are passed to <code>noSuchMethod</code>. If <code>noSuchMethod</code>
returns a value, that value becomes the result of the original
invocation.</p>
<p>The default behavior of <code>noSuchMethod</code> is to throw a
<code>noSuchMethodError</code>.</p>
<pre class="source">
external Dynamic noSuchMethod(String name, List args);
</pre>
</div>
</div>
<div class="method inherited"><h4 id="Object">
<button class="show-code">Code</button>
const <strong>Object</strong>() <a class="anchor-link" href="#Object"
              title="Permalink to Settings.Object">#</a></h4>
<div class="inherited-from">inherited from Object </div><div class="doc">
<p>Creates a new <code>Object</code> instance.</p>
<p><code>Object</code> instances have no meaningful state, and are only useful
through their identity. An <code>Object</code> instance is equal to itself
only.</p>
<pre class="source">
const Object();
</pre>
</div>
</div>
<div class="method inherited"><h4 id="toString">
<button class="show-code">Code</button>
String <strong>toString</strong>() <a class="anchor-link" href="#toString"
              title="Permalink to Settings.toString">#</a></h4>
<div class="inherited-from">inherited from Object </div><div class="doc">
<p>Returns a string representation of this object.</p>
<pre class="source">
external String toString();
</pre>
</div>
</div>
</div>
        </div>
        <div class="clear"></div>
        </div>
        
        <div class="footer">
          
        </div>
        <script async src="../client-live-nav.js"></script>
        </body></html>
        
